package com.hj.homework;

public class Test2 {
    public static void main(String[] args) {
        Person[] people = new Person[2];
        people[0]=new Woman();
        people[1]=new Man();
        for (Person person : people) {
            person.pee();
        }
    }
}
abstract class Person{
    public abstract void pee();
}
class Woman extends Person{
    @Override
    public void pee() {
        System.out.println("坐着尿");
    }
}
class Man extends Person{
    @Override
    public void pee() {
        System.out.println("站着尿");
    }
}
